   package com.javalong.affairs.module.notifything.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.javalong.affairs.R;
import com.javalong.affairs.base.adapter.BaseAdapter;
import com.javalong.affairs.base.constant.StatusCode;
import com.javalong.affairs.base.model.Auditor;

   public class AuditorStatisticAdapter extends BaseAdapter {
	public AuditorStatisticAdapter(Context context, List<?> dataList) {
		super(context, dataList);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		final Auditor user = (Auditor) getItem(position);
		ViewHolder holder;
		if (convertView != null) {
			holder = (ViewHolder) convertView.getTag();
		} else {
			holder = new ViewHolder();
			convertView = mInflater.inflate(R.layout.item_user_statistic, null);
			holder.tv_user = (TextView) convertView.findViewById(R.id.tv_user);
			holder.tv_status = (TextView) convertView
					.findViewById(R.id.tv_status);
			holder.ll_reason = (LinearLayout) convertView
					.findViewById(R.id.ll_reason);
			holder.tv_reason = (TextView) convertView
					.findViewById(R.id.tv_reason);
			convertView.setTag(holder);
			holder.ll_reason.setVisibility(View.GONE);
		}
		holder.tv_user.setText(user.name);
		holder.tv_status.setText(StatusCode.getSendStatus(user.status));
		return convertView;
	}

	class ViewHolder {
		TextView tv_user;
		TextView tv_status;
		LinearLayout ll_reason;
		TextView tv_reason;

	}

}
